home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
129_01
/
210ctdl.h
< prev
next >
Wrap
Text File
|
1985-03-09
|
15KB
|
434 lines
/* Ctdl210.h */
/* #include file for all Citadel C files. */
/* #defines 82Dec10 dvm */
/* */
/* #defs supported in current system: */
/* */
/* #def FDC-1 for the TeleTek (dvm code) */
/* #def VFC-2 for the Big Board (dvm code) */
/* */
/* #def TEST for special small-scale test version */
char firstExtern; /* this should ALWAYS be the first declaration */
char mData; /* Modem data port */
char megaHz; /* Z80 clock rate (for wait loops) */
unsigned secondsfactor; /* 8085 needs different from 8080/Z80 */
char *nodeName;
char *nodeTitle;
char *nodeId;
int cryptSeed;
char rcpm; /* TRUE to run in RCP/M mode */
char clock; /* TRUE if we have a hardware clock */
char homeDisk, homeUser, msgDisk; /* where we keep our data files */
char ourDisk, ourUser; /* where we are just now */
char unlogEnterOk; /* TRUE if OK to enter messages anon */
char unlogReadOk; /* TRUE if unlogged folks can read mess */
char unlogLoginOk; /* TRUE if spontan. new accounts ok. */
char nonAideRoomOk; /* TRUE general folks can make rooms */
char noMail; /* TRUE if mail is not allowed */
/* Citadel programs use readSysTab() and writeSysTab() to write an */
/* image of the external variables in RAM to disk, and later restore */
/* it. The image is stored in ctdlTabl.sys . If ctdlTabl.sys is lost, */
/* sysop.com will automatically reconstruct the hard way when invoked, */
/* and write a new ctdlTabl.sys out when finished. CtdlTabl.sys is */
/* always destroyed after reading, to minimize the possibility of */
/* reading an out-of-date version. In general, the technique works */
/* well and saves time and head-banging on bootup. You should, */
/* however, note carefully the following cautions: */
/* o "char firstExtern;" should >always< be the first */
/* declaration in citadel.h */
/* o "char lastExtern;" should >always< be the last */
/* declaration in citadel.h */
/* o Whenever you change the declarations in 210Ctdl.h you should: */
/* --> destroy the current ctdlTabl.sys file */
/* --> recompile and reload all citadel programs which access */
/* ctdlTabl.sys -- currently citadel.com & configur.com */
/* --> use configur.com to build a new ctdlTabl.sys file */
/* */
/* If you ignore these warnings, little pixies will prick you in your */
/* sleep for the rest of your life. */
/* stuff to distinguish the various Citadel programs */
#define CITADEL 0 /* prinipal program */
#define xxxxx 1 /* unused */
#define NET 2 /* network downloader (future) */
#define ARCHIVE 3 /* backup program (future) */
#define CONFIGURE 4 /* configuration program */
char weAre; /* set first thing by main() */
/* Stuff to size system with: */
/* WARNING!!! if you expand MAXROOMS beyond 128, horrible, horrible */
/* things will happen to the userlog entries, which will no longer */
/* fit in the assigned 256-byte records and will overwrite things */
/* with normally undesirable results. 82Nov10CrT */
#ifdef TEST
#define MAXROOMS 6
#define MAXLOGTAB 4
#else
#define MAXROOMS 64 /* number of rooms allowed in system */
#define MAXLOGTAB 180 /* number of log entries supported */
#endif
#define SECSPERROOM 2 /* sectors/room */
#define ROOMSECTORS (MAXROOMS*SECSPERROOM)
#define SECSPERLOG 3 /* three sectors per log record */
#define LOGSECTORS (MAXLOGTAB*SECSPERLOG)
/* Stuff nowadays usually in bdscio.h: */
/* values for functions to return: */
#define TRUE 1
#define FALSE 0
#define ERROR -1
#define SAMESTRING 0 /* value for strcmp() & friend */
/* ASCII characters: */
#define NULL 0
#define SOH 1
#define CNTRLC 3
#define EOT 4
#define ACK 6
#define BELL 7
#define BACKSPACE 8
#define CNTRLI 9 /* aka tab */
#define TAB 9 /* aka ^I */
#define NEWLINE 10 /* "linefeed" to philistines. */
#define CNTRLO 15
#define CNTRLp 16
#define XOFF 19 /* control-s */
#define NAK 21
#define CAN 24
#define CNTRLZ 26
#define CPMEOF CNTRLZ
#define ESC 27 /* altmode */
#define DEL 0x7F /* delete char */
/* for packing & unpacking ints: */
#define BYTE 256
/* Stuff for rooms: */
#define LOBBY 0 /* Lobby> is >always< room 0. */
#define MAILROOM 1 /* Mail> is >always< room 1. */
#define AIDEROOM 2 /* Aide> is >always< room 2. */
#define NAMESIZE 20 /* length of room names */
#ifdef TEST
#define MSGSPERRM 58 /* should be >= MAILSLOTS */
#else
#define MSGSPERRM 58 /* roombuf must be 256 bytes or less. */
#endif
#define FILSPERRM 10 /* roombuf must be 256 bytes or less. */
#define SECTSIZE 128
char debug; /* turns debug printout on and off */
int roomfl; /* file descriptor for ctdlRoom.sys */
#define UNREAD 0 /* Only list unread rooms */
#define ALMOST_ALL 1 /* List both unread and read rooms */
#define FORGOT 2 /* List forgotten public rooms */
#define INUSE 1 /* flags mask */
#define PUBLIC 2 /* flags mask */
#define CPMDIR 4 /* flags mask */
#define PERMROOM 8 /* flags mask */
#define SKIP 16 /* (temporary) flags mask for roomTab */
struct {
char rtgen; /* generation # of room */
char rtflags; /* public/private flag etc */
char rtname[NAMESIZE]; /* name of room */
unsigned rtlastMessage; /* # of most recent message in room */
} roomTab[MAXROOMS];
struct {
char rbgen; /* generation # of room */
char rbflags; /* same bits as flags above */
char rbname[NAMESIZE]; /* name of room */
char rbdisk; /* disk this rooms files are in 0=>none */
char rbuser; /* user area for this rooms files */
struct {
unsigned rbmsgNo; /* every message gets unique# */
int rbmsgLoc; /* sector message starts in */
} msg[MSGSPERRM];
#ifdef TEST
char rbOverRun[256];
#else
char rbOverRun[2]; /* actually unneeded just now -- roomBuf*/
#endif
/* is exactly 256 at present */
} roomBuf; /* buffer current room is held in */
char thisRoom; /* room currently in roomBuf */
/* userlog stuff */
#define CRYPTADD 117 /* */
#define UCMASK 1 /* bit uppercase flag is in */
#define LFMASK 2 /* bitmask for linefeed flag */
#define EXPERT 4 /* bitmask for expert-user flag */
#define TABMASK 8 /* bitmask for tab flag */
#define AIDE 16 /* bitmask for aide flag */
#define MAILSLOTS 58 /* twiddle to fit logBuf in 384 bytes */
#define GENSHIFT 3 /* lbgen >> GENSHIFT gives generation */
#define CALLMASK 7 /* lbgen & CALLMASK gives last visit */
#define MAXVISIT 8 /* #visits we remember old newestLo for */
#define MAXGEN 32 /* six bits of generation => 64 of them */
#define FORGET_OFFSET (MAXGEN / 2) /* For forgetting rooms */
/* logbuf must be 384 bytes or less... including lbOverFlow, 384 or MORE*/
struct logBuffer {
char lbnulls; /* #nulls, lCase, lFeeds */
char lbflags; /* UCMASK, LFMASK, EXPERT, TABMASK, AIDE*/
char lbwidth; /* terminal width */
char lbname[NAMESIZE]; /* caller's name */
char lbpw[NAMESIZE]; /* caller's password */
char lbgen[MAXROOMS]; /* 6 bits gen, two bits lastvisit */
int lbvisit[MAXVISIT];/* newestLo for this and 3 prev. visits */
int lbslot[MAILSLOTS];/* for private mail */
unsigned lbId[MAILSLOTS]; /* for private mail */
#ifdef TEST
char lbOverFlow[256];
#else
char lbOverFlow[84];
#endif
} logBuf;
int thisLog; /* entry currently in logBuf */
int thisSlot; /* logTab slot logBuf was found via */
int logfl; /* log file fd */
struct {
int ltpwhash; /* hash of password */
int ltnmhash; /* hash of name */
int ltlogSlot; /* location in userlog.buf */
int ltnewest; /* last message on last call */
} logTab[MAXLOGTAB];
int sizeLTentry; /* contains size of a l